﻿using Model.Manager.DataBase.EntityFramework;
using Model.Platform;

namespace Model.Manager.DataBase
{
    /// <summary>
    ///     数据库配置管理
    ///     By Dongyan
    ///     Creation Time: [ 2013/2/26 19:09:35 ]
    ///     Email: yan.dycn@gmail.com
    /// </summary>
    public class DbConfiger : IConfiger
    {

        /// <summary>
        ///     创建一个数据库容器
        /// </summary>
        /// <param name="dbName">默认为连接为业务逻辑数据库</param>
        /// <returns>数据库上下文</returns>
        public IDbContext CreateConext(DbConnections dbName)
        {

            switch (dbName)
            {
                case DbConnections.SystemicFunction:
                    return new DatabaseContext(new ModelContainer());

                default:
                    return new DatabaseContext(new BusinessLogic.ModelContainer());
            }
        }

        /// <summary>
        ///     TODO：注册配置文件上的DbProviderFactories
        /// </summary>
        public static void Provider()
        {

        }




    }
}